﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <include file="../inc/meta.inc" />
    <title></title>

</head>

<body>
    <div id="app" v-cloak>
        <div class="toolsbar">
            <btngroup show="删除,导出" ref='btngroup' @delete="deleteData" @output="btnOutput" path="RecordView" width="600"
                height="600" :selects='selects' idkey='Ma_ID' table="datatables"></btngroup>
            <query_panel :model="form" :width="45" :loading="loading"
                @search="handleCurrentChange(1)">
                <el-form-item label="时间区间">
                    <el-date-picker v-model="selectDate" type="daterange" align="right" unlink-panels
                        style="width: 220px;" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
                        :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="账号">
                    <el-input v-model="form.account" clearable placeholder="学员姓名/账号" style="width:160px"> </el-input>
                </el-form-item>
                <template slot="more">
                    <el-form-item label="资金来源">
                        <el-select v-model="form.from" placeholder="--来源--" style="width: 120px;">
                            <el-option v-for="item in moneyform" :label="item.label" :value="item.value"
                                :key="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="操作">
                        <el-radio-group v-model.number="form.type">
                            <el-radio-button v-for="item in moneytype" :label="item.value">
                                {{item.label}}</el-radio-button>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="金额">
                        <el-input v-model.number="form.moneymin" type="number">
                            <template slot="prepend">大于等于</template>
                            <template slot="append">元</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="">
                        <el-input v-model.number="form.moneymax" type="number">
                            <template slot="prepend">小于</template>
                            <template slot="append">元</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="流水号">
                        <el-input v-model="form.serial" placeholder="资金流水号"> </el-input>
                    </el-form-item>
                    <el-form-item label="状态">
                        <el-radio-group v-model.number="form.state">
                            <el-radio-button v-for="item in moneystate" :label="item.value">
                                {{item.label}}</el-radio-button>
                        </el-radio-group>
                    </el-form-item>
                </template>
            </query_panel>
        </div>

        <template>
            <el-table ref="datatables" :data="datas" :stripe="true" tooltip-effect="dark" style="width: 100%"
                @selection-change="val=>selects=val" @row-dblclick="rowdblclick" :height="tableHeight">
                <el-table-column type="selection" width="35">
                </el-table-column>
                <el-table-column type="index" width="50" align="center">
                    <template slot-scope="scope">
                        <span>{{(form.index - 1) * form.size + scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="金额/余额" align="center" width="150">
                    <template slot-scope="scope">
                        <span :class="scope.row.Ma_Type==1 ? 'pay' : 'income'">
                            <span v-if="scope.row.Ma_Type==1">支出</span>
                            <span v-if="scope.row.Ma_Type==2">充值</span>
                            <icon money style="font-size: 14px;">
                                {{scope.row.Ma_Money}}元
                            </icon>
                        </span>
                        <span class="money">/ {{Math.floor(scope.row.Ma_Total*100)/100}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="时间" width="150" align="center">
                    <template slot-scope="scope">
                        {{scope.row.Ma_CrtTime|date("yyyy-MM-dd HH:mm:ss")}}
                    </template>
                </el-table-column>
                <el-table-column label="状态" width="120" align="center">
                    <template slot-scope="scope">
                        <el-tag type="success" v-if="scope.row.Ma_IsSuccess">
                            <icon>&#xa048</icon>成功
                        </el-tag>
                        <loading v-else-if="loading_query==scope.row.Ma_ID"></loading>
                        <template v-else>
                            <el-tag type="danger">失败</el-tag>
                            <el-link type="primary" @click="queryOrder(scope.row)">查询</el-link>
                        </template>
                    </template>
                </el-table-column>
                <el-table-column label="姓名/账号">
                    <template slot-scope="scope">
                        <span>{{scope.row.Ac_Name}}</span>
                        <span class="acname">({{scope.row.Ac_AccName}})</span>
                    </template>
                </el-table-column>
                <el-table-column label="流水号">
                    <template slot-scope="scope">
                        {{scope.row.Ma_Serial}} </template>
                </el-table-column>
                <el-table-column label="说明">
                    <template slot-scope="scope">
                        {{scope.row.Ma_Info}} </template>
                </el-table-column>
                <el-table-column label="操作" show-overflow-tooltip width="100" align="center">
                    <template slot-scope="scope">
                        <el-link type="primary" plain icon="el-icon-view"
                            @click='$refs.btngroup.modifyrow(scope.row,"查看")'>查看</el-link>

                        <el-popconfirm confirm-button-text='是的' cancel-button-text='不用' icon="el-icon-info"
                            icon-color="red" title="确定删除吗？" @confirm="$refs.btngroup.delete(scope.row.Ma_ID)">
                            <el-link type="danger" plain icon="el-icon-delete" slot="reference">删除
                            </el-link>
                        </el-popconfirm>

                    </template>
                </el-table-column>
            </el-table>

        </template>
        <div id="pager-box">
            <el-pagination v-on:current-change="handleCurrentChange" :current-page="form.index" :page-sizes="[1]"
                :page-size="form.size" :pager-count="10" layout="total, prev, pager, next, jumper" :total="total">
            </el-pagination>
        </div>
    </div>


</body>

</html>